The following sections describe changes in the storage location for profiles in ColorSync 2.5.
The ColorSync Profiles folder is now located in the System folder, rather than in the Preferences folder. This protects profiles from deletion should you accidentally or purposefully delete your Preferences folder. More importantly, placement in the System folder will allow the profiles folder to become a "magic" folder, providing the following benefits:
FindFolder
routine to find the profiles folder.CMGetColorSyncFolderSpec
function to obtain the location of the profiles folder--it should not use a hard-coded path to a specific folder.
For backward compatibility, ColorSync automatically inserts into the new profiles folder an alias to the old location (inside the Preferences folder), if that folder exists and contains any profiles.
With ColorSync 2.5, profile search routines look for profiles in the following locations:
With this new searching support, you can group profiles in subfolders within the profiles folder (one level of subfolders is currently allowed). For example, you might store all scanner profiles in one folder and a variety of monitor profiles for your primary monitor in another. You can also store aliases to other profiles and profile folders within the ColorSync Profiles folder. ColorSync search routines will find all profiles in the specified locations.
ColorSync now provides the NCMGetProfileLocation
function for obtaining a profile location. This function differs from its predecessor, the CMGetProfileLocation
function, in that you now pass the size of the location structure to be filled in. You should use the newer version for the following reasons:
CMGetProfileLocation
) may not be as easily ported to other platforms.NCMGetProfileLocation
ensures that the profile location structure can grow, if necessary, in the future.
The NCMGetProfileLocation
function is defined as follows:
pascal CMError NCMGetProfileLocation ( CMProfileRef prof, CMProfileLocation * profLoc, unsigned long * locationSize);
prof
|
A profile reference of type CMProfileRef . Before calling NCMGetProfileLocation , you set the reference to specify the profile you wish to obtain the location for.
|
profLoc
|
A pointer to a profile location structure, as described in .Advanced Color Imaging on the Mac OS. If you pass NULL
, NCMGetProfileLocation
returns the size of the profile location structure for the profile specified by prof
in the locationSize
parameter. If you instead pass a pointer to memory you have allocated for the structure, on return, the structure specifies the location of the profile specified by prof
.
|
locationSize
|
A pointer to a value of type long . If you pass NULL
for the profLoc
parameter, on return, locationSize
contains the size in bytes of the profile location structure for the profile specified by prof
. If you pass a pointer to a profile location structure in profLoc
, set locationSize
to the size of the structure before calling NCMGetProfileLocation
.
|
function result |
A result code of type CMError
. See Advanced Color Imaging on the Mac OS for a list of ColorSync-specific result code values.
|
The NCMGetProfileLocation
function is available starting with ColorSync version 2.5. The best way to use NCMGetProfileLocation
is to call it twice:
prof
parameter and NULL
for the profLoc
parameter. NCMGetProfileLocation
returns the size of the location structure in the locationSize
parameter.profLoc
parameter; on return, the structure specifies the location of the profile.
It is possible to call NCMGetProfileLocation
just once, using the constant cmCurrentProfileLocationSize
for the size of the allocated profile location structure and passing the same constant for the locationSize
parameter. The constant cmCurrentProfileLocationSize
may change in the future, but will be consistent within the set of headers you build your application with. However, if the size of the CMProfileLocation structure changes in a future version of ColorSync and you do not rebuild your application, NCMGetProfileLocation
may return an error.